Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include ReactNode in render method result #1062

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

steinybot
Copy link

Fixes #1061

Comment on lines +63 to +66
new Redirect({
from: 'baz',
to: '/foo',
}),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is what didn't compile despite it being valid.

@@ -20,7 +20,7 @@ export default function createElements(
routeMatches: Array<RouteMatch>,
Components: React.ComponentType<any>[],
matchData: any,
): Array<ResolvedElement | undefined> {
): Array<React.ReactNode | ResolvedElement | undefined> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the correct fix, This method _doesn't) actually return a ReactNode, it only turns route component elements. The problem is Redirect.render shouldn't return a ReactNode

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh ok. I didn't do that since it was a potentially breaking change. I've changed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Type of children does not match basic example
2 participants